//### Updates step, score and deadline beliefs
/*
+step(S) <-
	.print("Step: ", S).
*/
	
/***************************************/
/***Rileva l'inizio della simulazione***/
/***************************************/
+simStart  <-
	.print("Simulation has started!!");
	!select_goal.

/***************************************/
/***Rileva la fine della simulazione****/
/***************************************/
+simEnd 
   <- .abolish(_); // clean all BB
      .drop_all_desires.

// the following plan is used to send only one action each cycle
+!do_and_wait_next_step(Act)
    : step(S)
   <- Act; // perform the action (i.e., send the action to the simulator)
      !wait_next_step(S). // wait for the next step before going on

+!wait_next_step(S)  : step(S+1).
+!wait_next_step(S) <- .wait( { +step(_) }, 500, _); !wait_next_step(S).
      
/****************************************/
/***Wrapper per l'acquisto di upgrade****/
/****************************************/
+!buy(X) 
    : money(M)
   <- .print("I am going to buy ",X,"! My money is ",M);
      !do_and_wait_next_step(buy(X)).

//### Updates vertex control
/*
+visibleVertex(Vertex,Team) <-
	-+visibleVertex(Vertex,Team).
*/